package com.beesphere.products.throttling.impl;

import com.beesphere.products.throttling.UnitOfWorkCapacity;

public class DefaultUnitOfWorkCapacity implements UnitOfWorkCapacity {
	
	private static final long serialVersionUID = 3988979771633492805L;

    private String name;
    private String group;

    private long maximumWaitingRequests;
    private long maximumRequestsPerPeriod;
    private long timePeriodMillis; 
    private long startTimeMillis;
    private long stackSize;
    private int priority = Thread.NORM_PRIORITY;
    private boolean daemon;
    private int taskQueue = 5;
    private long keepAliveTime;
    private int maxSize = 1;
    private int coreSize = 1;
	private long timeout;
    private long waitingRequestTimeout;
    private long waitTimeout = 5*60*1000;  // 5 minutes
    public String queueType = QUEUE_TYPE_DEQUE;
	
    public DefaultUnitOfWorkCapacity () {
    }
    
    public DefaultUnitOfWorkCapacity (String group, String name) {
    	this.group = group;
    	this.name = name;
    }
    
	public long getMaximumRequestsPerPeriod() {
		return maximumRequestsPerPeriod;
	}
	public void setMaximumRequestsPerPeriod(long maximumRequestsPerPeriod) {
		this.maximumRequestsPerPeriod = maximumRequestsPerPeriod;
	}
	public long getTimePeriodMillis() {
		return timePeriodMillis;
	}
	public void setTimePeriodMillis(long timePeriodMillis) {
		this.timePeriodMillis = timePeriodMillis;
	}
	public long getStartTimeMillis() {
		return startTimeMillis;
	}
	public void setStartTimeMillis(long startTimeMillis) {
		this.startTimeMillis = startTimeMillis;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getGroup() {
		return group;
	}
	public void setGroup(String group) {
		this.group = group;
	}
	public long getStackSize() {
		return stackSize;
	}
	public void setStackSize(long stackSize) {
		this.stackSize = stackSize;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	public boolean isDaemon() {
		return daemon;
	}
	public void setDaemon(boolean daemon) {
		this.daemon = daemon;
	}
	public int getTaskQueue() {
		return taskQueue;
	}
	public void setTaskQueue(int taskQueue) {
		this.taskQueue = taskQueue;
	}
	public long getKeepAliveTime() {
		return keepAliveTime;
	}
	public void setKeepAliveTime(long keepAliveTime) {
		this.keepAliveTime = keepAliveTime;
	}
	public int getMaxSize() {
		return maxSize;
	}
	public void setMaxSize(int maxSize) {
		this.maxSize = maxSize;
	}
	public int getCoreSize() {
		return coreSize;
	}
	public void setCoreSize(int coreSize) {
		this.coreSize = coreSize;
	}

	public long getTimeout() {
		return timeout;
	}

	public void setTimeout(long timeout) {
		this.timeout = timeout;
	}

	public long getWaitTimeout() {
		return waitTimeout;
	}

	public void setWaitTimeout(long waitTimeout) {
		this.waitTimeout = waitTimeout;
	}

	public String getQueueType() {
		return queueType;
	}

	public void setQueueType(String queueType) {
		this.queueType = queueType;
	}

    public long getMaximumWaitingRequests () {
		return maximumWaitingRequests;
	}

	public void setMaximumWaitingRequests (long maximumWaitingRequests) {
		this.maximumWaitingRequests = maximumWaitingRequests;
	}

	public long getWaitingRequestTimeout () {
		return waitingRequestTimeout;
	}

	public void setWaitingRequestTimeout (long waitingRequestTimeout) {
		this.waitingRequestTimeout = waitingRequestTimeout;
	}
}
